﻿using System;
using System.Collections.Generic;
using System.Text;
using Catalina.Common;
using Catalina.Dal;
using System.ComponentModel;

namespace Catalina.MVP
{
	public class CatalinaModel : INotifyPropertyChanged
	{
		// ----------------------------------------------------------
		// Constructor
		#region ...

		public CatalinaModel()
		{
			headers = new BindingList<CatalinaHeader>();
		}

		#endregion

		// ----------------------------------------------------------
		// Public Methods
		#region ...



		#endregion

		// ----------------------------------------------------------
		// Protected Methods
		#region ...

		protected void OnPropertyChanged(string name)
		{
			PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
				handler(this, new PropertyChangedEventArgs(name));
		}

		#endregion

		// ----------------------------------------------------------
		// Properties
		#region ...

		public BindingList<CatalinaHeader> Headers
		{
			get { return headers; }
			set 
			{
				if (value != headers)
				{
					headers = value;
					OnPropertyChanged("HeadersTable");
				}
			}
		}

		#endregion

		// ----------------------------------------------------------
		// Members
		#region ...

		private BindingList<CatalinaHeader> headers;

		#endregion

		public event PropertyChangedEventHandler PropertyChanged;
	}
}
